import axios from '../../utils/axios'

// 登陆
export const asLogin = function (params) {
  return axios.post(`${baseApi}/assessment/login`, params)
}

// 查询指标列表
export const getIndicatorList = function () {
  return axios.get(`${baseApi}/indicator/getIndicatorList/`)
}
// 新增或修改指标（修改时带上参数indicatorId）
export const addOrUpdateIndicator = function (params) {
  return axios.post(`${baseApi}/indicator/addOrUpdateIndicator/`, params)
}
// 删除指标
export const deleteIndicator = function (id) {
  return axios.get(`${baseApi}/indicator/deleteIndicator/${id}`)
}

// 获取用户列表
export const getAssessmentUserList = function () {
  // return axios.get(`${baseApi}/assessment/getAssessmentUserList/`)
  return axios.get(`${ccmsApi}ccms/org/employee/_search?treeId=8113&page=1&size=99999`);
}



// 查询考核列表
export const getAssessmentList = function (params) {
  return axios.post(`${baseApi}/assessment/getAssessmentList`, params)
}

// 新增或修改考核（修改时带上参数assessmentId）
export const addOrUpdateAssessment = function (params) {
  return axios.post(`${baseApi}/assessment/addOrUpdateAssessment`, params)
}

// 考核详情
export const getAssessmentInfo = function (id) {
  return axios.get(`${baseApi}/assessment/getAssessmentInfo/${id}`)
}
// 删除考核
export const deleteAssessmemt = function (id) {
  return axios.get(`${baseApi}/assessment/deleteAssessmemt/${id}`)
}

// 考核
export const addAssessmentScore = function (params) {
  return axios.post(`${baseApi}/assessment/addAssessmentScore`, params)
}

// 考核统计
export const statisticsAssessmentList = function (params) {
  return axios.post(`${baseApi}/assessment/statisticsAssessmentList`, params)
}

// 导出考核统计
export const exportExcel = function (id) {
  return axios.get(`${baseApi}/assessment/exportExcel`,{
    responseType: 'blob'
  })
}

// 重置密码
export const resetPassword = function (params) {
  return axios.get(`${baseApi}/assessment/resetPassword`,params)
}

// 修改密码
export const updatePassword = function (params) {
  return axios.post(`${baseApi}/assessment/updatePassword`, params)
}

